package com.atomikos.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserService {

    @Transactional(value="transactionManager")
    public void insertData() throws Exception {
//        User user = new User();
//        user.setId(new Random().nextInt());
//        user.setName(“wenqy”);
//        userMapper.saveUser( user );
////      if (true) {
////          throw new RuntimeException(“insert failure”);
////      }
//        Person person = new Person();
//        person.setId(new Random().nextInt());
//        person.setEmail(“wen.qy@qq.com”);
//        personMapper.savePerson( person );
////      if (true) {
////          throw new RuntimeException(“insert failure”);
////      }
    }

}
